/**
 * @ author: 汪孟苹
 */
define(["jquery",
    "scprit/followup/app/datatable/datatable.ui.js",
    "scprit/followup/app/healthAssess/healthPatient.servers.js",
    "scprit/followup/app/healthAssess/healthPatient.ui.js",
    "scprit/followup/app/healthAssess/healthPatient.event.js"],
    function ($,$datatableUi,$healthPatientServers,$healthPatientUi,$healthPatientEvent) {
	var healthPatient = {};

	var commInit = function(data){
        $("#addQuestBtn").data({"value":data});
        $("#addQuestBtn").click($healthPatientEvent.onAddHealthQuest);
        $datatableUi.init({
            "id": data.tableId,
            "options": $healthPatientServers.getOptions()
        });
    }

    var getExtInfo = function(extInfo){
        var pageParams = $healthPatientServers.getPageParams();
        $healthPatientUi.titInit({
            "id": "healthPatientTit",
            "tit":extInfo.listName
        });
        var data = {
            tableId:"healthPatient",
            goToQuest:pageParams.goToQuest,
            busiId:pageParams.busiId,
            goToRecord:pageParams.goToRecord,
            extInfo:extInfo
        };
        commInit(data); 
    }

	healthPatient.init = function(){
        $healthPatientServers.ajaxTit(getExtInfo);
	}; 
	
	return healthPatient;
});